home *** CD-ROM | disk | FTP | other *** search
/ Amiga CD-Sensation: Golden Games / Amiga CD-Sensation - Ausgabe 2 - Golden Games (1996)(GTI - Schatztruhe)(DE)[!].iso / Brain Activity / UChess / Source / Windows.h < prev   
C/C++ Source or Header  |  1992-11-19  |  16KB  |  434 lines

  1.  
  2. struct NewScreen NewScreenStructure = {
  3.     0,0,    /* screen XY origin relative to View */
  4.     640,400,    /* screen width and height */
  5.     4,    /* screen depth (number of bitplanes) */
  6.     0,1,    /* detail and block pens */
  7.     LACE+HIRES,    /* display modes for this screen */
  8.     CUSTOMSCREEN,    /* screen type */
  9.     &NULL,    /* pointer to default screen font */
  10.     "UChess v1.0",    /* screen title */
  11.     NULL,    /* first in list of custom screen gadgets */
  12.     NULL    /* pointer to custom BitMap structure */
  13. };
  14.  
  15. #define NEWSCREENSTRUCTURE NewScreenStructure
  16.  
  17. USHORT Palette[] = {
  18.     0x0455,    /* color #0 */
  19.     0x0CCE,    /* color #1 */
  20.     0x0FFF,    /* color #2 */
  21.     0x068B,    /* color #3 */
  22.     0x000F,    /* color #4 */
  23.     0x0F0F,    /* color #5 */
  24.     0x00FF,    /* color #6 */
  25.     0x0FFF,    /* color #7 */
  26.     0x0620,    /* color #8 */
  27.     0x0E50,    /* color #9 */
  28.     0x09F1,    /* color #10 */
  29.     0x0EB0,    /* color #11 */
  30.     0x055F,    /* color #12 */
  31.     0x092F,    /* color #13 */
  32.     0x00F8,    /* color #14 */
  33.     0x0CCC    /* color #15 */
  34. #define PaletteColorCount 16
  35. };
  36.  
  37. #define PALETTE Palette
  38.  
  39. struct TextAttr TOPAZ80 = {
  40.     (STRPTR)"topaz.font",
  41.     TOPAZ_EIGHTY,0,0
  42. };
  43. struct IntuiText IText1 = {
  44.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  45.     0,0,    /* XY origin relative to container TopLeft */
  46.     &TOPAZ80,    /* font pointer or NULL for default */
  47.     "Set Time",    /* pointer to text */
  48.     NULL    /* next IntuiText structure */
  49. };
  50.  
  51. struct MenuItem MenuItem3 = {
  52.     NULL,    /* next MenuItem structure */
  53.     0,16,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  54.     72,8,    /* hit box width and height */
  55.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  56.     0,    /* each bit mutually-excludes a same-level Item */
  57.     (APTR)&IText1,    /* Item render  (IntuiText or Image or NULL) */
  58.     NULL,    /* Select render */
  59.     NULL,    /* alternate command-key */
  60.     NULL,    /* SubItem list */
  61.     MENUNULL    /* filled in by Intuition for drag selections */
  62. };
  63.  
  64. struct IntuiText IText2 = {
  65.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  66.     0,0,    /* XY origin relative to container TopLeft */
  67.     &TOPAZ80,    /* font pointer or NULL for default */
  68.     "Test",    /* pointer to text */
  69.     NULL    /* next IntuiText structure */
  70. };
  71.  
  72. struct MenuItem MenuItem2 = {
  73.     &MenuItem3,    /* next MenuItem structure */
  74.     0,8,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  75.     72,8,    /* hit box width and height */
  76.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  77.     0,    /* each bit mutually-excludes a same-level Item */
  78.     (APTR)&IText2,    /* Item render  (IntuiText or Image or NULL) */
  79.     NULL,    /* Select render */
  80.     NULL,    /* alternate command-key */
  81.     NULL,    /* SubItem list */
  82.     MENUNULL    /* filled in by Intuition for drag selections */
  83. };
  84.  
  85. struct IntuiText IText3 = {
  86.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  87.     0,0,    /* XY origin relative to container TopLeft */
  88.     &TOPAZ80,    /* font pointer or NULL for default */
  89.     "Hint",    /* pointer to text */
  90.     NULL    /* next IntuiText structure */
  91. };
  92.  
  93. struct MenuItem MenuItem1 = {
  94.     &MenuItem2,    /* next MenuItem structure */
  95.     0,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  96.     72,8,    /* hit box width and height */
  97.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  98.     0,    /* each bit mutually-excludes a same-level Item */
  99.     (APTR)&IText3,    /* Item render  (IntuiText or Image or NULL) */
  100.     NULL,    /* Select render */
  101.     'H',    /* alternate command-key */
  102.     NULL,    /* SubItem list */
  103.     MENUNULL    /* filled in by Intuition for drag selections */
  104. };
  105.  
  106. struct Menu Menu4 = {
  107.     NULL,    /* next Menu structure */
  108.     162,0,    /* XY origin of Menu hit box relative to screen TopLeft */
  109.     63,0,    /* Menu hit box width and height */
  110.     MENUENABLED,    /* Menu flags */
  111.     "Special",    /* text of Menu name */
  112.     &MenuItem1    /* MenuItem linked list pointer */
  113. };
  114.  
  115. struct IntuiText IText4 = {
  116.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  117.     19,0,    /* XY origin relative to container TopLeft */
  118.     &TOPAZ80,    /* font pointer or NULL for default */
  119.     "Thinking",    /* pointer to text */
  120.     NULL    /* next IntuiText structure */
  121. };
  122.  
  123. struct MenuItem MenuItem8 = {
  124.     NULL,    /* next MenuItem structure */
  125.     0,32,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  126.     123,8,    /* hit box width and height */
  127.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  128.     0,    /* each bit mutually-excludes a same-level Item */
  129.     (APTR)&IText4,    /* Item render  (IntuiText or Image or NULL) */
  130.     NULL,    /* Select render */
  131.     'T',    /* alternate command-key */
  132.     NULL,    /* SubItem list */
  133.     MENUNULL    /* filled in by Intuition for drag selections */
  134. };
  135.  
  136. struct IntuiText IText5 = {
  137.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  138.     0,0,    /* XY origin relative to container TopLeft */
  139.     &TOPAZ80,    /* font pointer or NULL for default */
  140.     "Undo",    /* pointer to text */
  141.     NULL    /* next IntuiText structure */
  142. };
  143.  
  144. struct MenuItem MenuItem7 = {
  145.     &MenuItem8,    /* next MenuItem structure */
  146.     0,24,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  147.     123,8,    /* hit box width and height */
  148.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  149.     0,    /* each bit mutually-excludes a same-level Item */
  150.     (APTR)&IText5,    /* Item render  (IntuiText or Image or NULL) */
  151.     NULL,    /* Select render */
  152.     'U',    /* alternate command-key */
  153.     NULL,    /* SubItem list */
  154.     MENUNULL    /* filled in by Intuition for drag selections */
  155. };
  156.  
  157. struct IntuiText IText6 = {
  158.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  159.     0,0,    /* XY origin relative to container TopLeft */
  160.     &TOPAZ80,    /* font pointer or NULL for default */
  161.     "Move Now",    /* pointer to text */
  162.     NULL    /* next IntuiText structure */
  163. };
  164.  
  165. struct MenuItem MenuItem6 = {
  166.     &MenuItem7,    /* next MenuItem structure */
  167.     0,16,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  168.     123,8,    /* hit box width and height */
  169.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  170.     0,    /* each bit mutually-excludes a same-level Item */
  171.     (APTR)&IText6,    /* Item render  (IntuiText or Image or NULL) */
  172.     NULL,    /* Select render */
  173.     'M',    /* alternate command-key */
  174.     NULL,    /* SubItem list */
  175.     MENUNULL    /* filled in by Intuition for drag selections */
  176. };
  177.  
  178. struct IntuiText IText7 = {
  179.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  180.     0,0,    /* XY origin relative to container TopLeft */
  181.     &TOPAZ80,    /* font pointer or NULL for default */
  182.     "AutoPlay",    /* pointer to text */
  183.     NULL    /* next IntuiText structure */
  184. };
  185.  
  186. struct MenuItem MenuItem5 = {
  187.     &MenuItem6,    /* next MenuItem structure */
  188.     0,8,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  189.     123,8,    /* hit box width and height */
  190.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  191.     0,    /* each bit mutually-excludes a same-level Item */
  192.     (APTR)&IText7,    /* Item render  (IntuiText or Image or NULL) */
  193.     NULL,    /* Select render */
  194.     NULL,    /* alternate command-key */
  195.     NULL,    /* SubItem list */
  196.     MENUNULL    /* filled in by Intuition for drag selections */
  197. };
  198.  
  199. struct IntuiText IText8 = {
  200.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  201.     0,0,    /* XY origin relative to container TopLeft */
  202.     &TOPAZ80,    /* font pointer or NULL for default */
  203.     "Swap Sides",    /* pointer to text */
  204.     NULL    /* next IntuiText structure */
  205. };
  206.  
  207. struct MenuItem MenuItem4 = {
  208.     &MenuItem5,    /* next MenuItem structure */
  209.     0,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  210.     123,8,    /* hit box width and height */
  211.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  212.     0,    /* each bit mutually-excludes a same-level Item */
  213.     (APTR)&IText8,    /* Item render  (IntuiText or Image or NULL) */
  214.     NULL,    /* Select render */
  215.     'S',    /* alternate command-key */
  216.     NULL,    /* SubItem list */
  217.     MENUNULL    /* filled in by Intuition for drag selections */
  218. };
  219.  
  220. struct Menu Menu3 = {
  221.     &Menu4,    /* next Menu structure */
  222.     92,0,    /* XY origin of Menu hit box relative to screen TopLeft */
  223.     63,0,    /* Menu hit box width and height */
  224.     MENUENABLED,    /* Menu flags */
  225.     "Control",    /* text of Menu name */
  226.     &MenuItem4    /* MenuItem linked list pointer */
  227. };
  228.  
  229. struct IntuiText IText9 = {
  230.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  231.     0,0,    /* XY origin relative to container TopLeft */
  232.     &TOPAZ80,    /* font pointer or NULL for default */
  233.     "ReverseBoard",    /* pointer to text */
  234.     NULL    /* next IntuiText structure */
  235. };
  236.  
  237. struct MenuItem MenuItem11 = {
  238.     NULL,    /* next MenuItem structure */
  239.     0,16,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  240.     96,8,    /* hit box width and height */
  241.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  242.     0,    /* each bit mutually-excludes a same-level Item */
  243.     (APTR)&IText9,    /* Item render  (IntuiText or Image or NULL) */
  244.     NULL,    /* Select render */
  245.     NULL,    /* alternate command-key */
  246.     NULL,    /* SubItem list */
  247.     MENUNULL    /* filled in by Intuition for drag selections */
  248. };
  249.  
  250. struct IntuiText IText10 = {
  251.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  252.     19,0,    /* XY origin relative to container TopLeft */
  253.     &TOPAZ80,    /* font pointer or NULL for default */
  254.     "3D",    /* pointer to text */
  255.     NULL    /* next IntuiText structure */
  256. };
  257.  
  258. struct MenuItem MenuItem10 = {
  259.     &MenuItem11,    /* next MenuItem structure */
  260.     0,8,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  261.     96,8,    /* hit box width and height */
  262.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  263.     0,    /* each bit mutually-excludes a same-level Item */
  264.     (APTR)&IText10,    /* Item render  (IntuiText or Image or NULL) */
  265.     NULL,    /* Select render */
  266.     NULL,    /* alternate command-key */
  267.     NULL,    /* SubItem list */
  268.     MENUNULL    /* filled in by Intuition for drag selections */
  269. };
  270.  
  271. struct IntuiText IText11 = {
  272.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  273.     19,0,    /* XY origin relative to container TopLeft */
  274.     &TOPAZ80,    /* font pointer or NULL for default */
  275.     "2-D",    /* pointer to text */
  276.     NULL    /* next IntuiText structure */
  277. };
  278.  
  279. struct MenuItem MenuItem9 = {
  280.     &MenuItem10,    /* next MenuItem structure */
  281.     0,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  282.     96,8,    /* hit box width and height */
  283.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  284.     0,    /* each bit mutually-excludes a same-level Item */
  285.     (APTR)&IText11,    /* Item render  (IntuiText or Image or NULL) */
  286.     NULL,    /* Select render */
  287.     NULL,    /* alternate command-key */
  288.     NULL,    /* SubItem list */
  289.     MENUNULL    /* filled in by Intuition for drag selections */
  290. };
  291.  
  292. struct Menu Menu2 = {
  293.     &Menu3,    /* next Menu structure */
  294.     46,0,    /* XY origin of Menu hit box relative to screen TopLeft */
  295.     39,0,    /* Menu hit box width and height */
  296.     MENUENABLED,    /* Menu flags */
  297.     "View",    /* text of Menu name */
  298.     &MenuItem9    /* MenuItem linked list pointer */
  299. };
  300.  
  301. struct IntuiText IText12 = {
  302.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  303.     0,0,    /* XY origin relative to container TopLeft */
  304.     &TOPAZ80,    /* font pointer or NULL for default */
  305.     "Quit",    /* pointer to text */
  306.     NULL    /* next IntuiText structure */
  307. };
  308.  
  309. struct MenuItem MenuItem15 = {
  310.     NULL,    /* next MenuItem structure */
  311.     0,24,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  312.     72,8,    /* hit box width and height */
  313.     ITEMTEXT+COMMSEQ+ITEMENABLED+HIGHCOMP,    /* Item flags */
  314.     0,    /* each bit mutually-excludes a same-level Item */
  315.     (APTR)&IText12,    /* Item render  (IntuiText or Image or NULL) */
  316.     NULL,    /* Select render */
  317.     'Q',    /* alternate command-key */
  318.     NULL,    /* SubItem list */
  319.     MENUNULL    /* filled in by Intuition for drag selections */
  320. };
  321.  
  322. struct IntuiText IText13 = {
  323.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  324.     0,0,    /* XY origin relative to container TopLeft */
  325.     &TOPAZ80,    /* font pointer or NULL for default */
  326.     "Save Game",    /* pointer to text */
  327.     NULL    /* next IntuiText structure */
  328. };
  329.  
  330. struct MenuItem MenuItem14 = {
  331.     &MenuItem15,    /* next MenuItem structure */
  332.     0,16,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  333.     72,8,    /* hit box width and height */
  334.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  335.     0,    /* each bit mutually-excludes a same-level Item */
  336.     (APTR)&IText13,    /* Item render  (IntuiText or Image or NULL) */
  337.     NULL,    /* Select render */
  338.     NULL,    /* alternate command-key */
  339.     NULL,    /* SubItem list */
  340.     MENUNULL    /* filled in by Intuition for drag selections */
  341. };
  342.  
  343. struct IntuiText IText14 = {
  344.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  345.     0,0,    /* XY origin relative to container TopLeft */
  346.     &TOPAZ80,    /* font pointer or NULL for default */
  347.     "Load Game",    /* pointer to text */
  348.     NULL    /* next IntuiText structure */
  349. };
  350.  
  351. struct MenuItem MenuItem13 = {
  352.     &MenuItem14,    /* next MenuItem structure */
  353.     0,8,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  354.     72,8,    /* hit box width and height */
  355.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  356.     0,    /* each bit mutually-excludes a same-level Item */
  357.     (APTR)&IText14,    /* Item render  (IntuiText or Image or NULL) */
  358.     NULL,    /* Select render */
  359.     NULL,    /* alternate command-key */
  360.     NULL,    /* SubItem list */
  361.     MENUNULL    /* filled in by Intuition for drag selections */
  362. };
  363.  
  364. struct IntuiText IText15 = {
  365.     3,1,COMPLEMENT,    /* front and back text pens, drawmode and fill byte */
  366.     0,0,    /* XY origin relative to container TopLeft */
  367.     &TOPAZ80,    /* font pointer or NULL for default */
  368.     "About..",    /* pointer to text */
  369.     NULL    /* next IntuiText structure */
  370. };
  371.  
  372. struct MenuItem MenuItem12 = {
  373.     &MenuItem13,    /* next MenuItem structure */
  374.     0,0,    /* XY of Item hitbox relative to TopLeft of parent hitbox */
  375.     72,8,    /* hit box width and height */
  376.     ITEMTEXT+ITEMENABLED+HIGHCOMP,    /* Item flags */
  377.     0,    /* each bit mutually-excludes a same-level Item */
  378.     (APTR)&IText15,    /* Item render  (IntuiText or Image or NULL) */
  379.     NULL,    /* Select render */
  380.     NULL,    /* alternate command-key */
  381.     NULL,    /* SubItem list */
  382.     MENUNULL    /* filled in by Intuition for drag selections */
  383. };
  384.  
  385. struct Menu Menu1 = {
  386.     &Menu2,    /* next Menu structure */
  387.     0,0,    /* XY origin of Menu hit box relative to screen TopLeft */
  388.     39,0,    /* Menu hit box width and height */
  389.     MENUENABLED,    /* Menu flags */
  390.     "File",    /* text of Menu name */
  391.     &MenuItem12    /* MenuItem linked list pointer */
  392. };
  393.  
  394. #define MenuList1 Menu1
  395.  
  396. struct NewWindow NewWindowStructure1 = {
  397.     0,0,    /* window XY origin relative to TopLeft of screen */
  398.     640,400,    /* window width and height */
  399.     0,1,    /* detail and block pens */
  400.     MOUSEBUTTONS+MENUPICK+VANILLAKEY,    /* IDCMP flags */
  401.     BACKDROP+BORDERLESS+ACTIVATE+NOCAREREFRESH,    /* other window flags */
  402.     NULL,    /* first gadget in gadget list */
  403.     NULL,    /* custom CHECKMARK imagery */
  404.     " ",    /* window title */
  405.     NULL,    /* custom screen pointer */
  406.     NULL,    /* custom bitmap */
  407.     640,400,    /* minimum width and height */
  408.     -1,-1,    /* maximum width and height */
  409.     CUSTOMSCREEN    /* destination screen type */
  410. };
  411.  
  412.  
  413. void HandleEvent(object)
  414. APTR object;
  415. {
  416.   if (object == (APTR)&MenuItem12) { DoAbout(object); return; }
  417.   if (object == (APTR)&MenuItem13) { LoadAGame(object); return; }
  418.   if (object == (APTR)&MenuItem14) { SaveAGame(object); return; }
  419.   if (object == (APTR)&MenuItem15) { DoQuit(object); return; }
  420.   if (object == (APTR)&MenuItem9) { Go2D(object); return; }
  421.   if (object == (APTR)&MenuItem10) { Go3D(object); return; }
  422.   if (object == (APTR)&MenuItem11) { DoReverse(object); return; }
  423.   if (object == (APTR)&MenuItem4) { DoSwap(object); return; }
  424.   if (object == (APTR)&MenuItem5) { DoAutoPlay(object); return; }
  425.   if (object == (APTR)&MenuItem6) { MoveNow(object); return; }
  426.   if (object == (APTR)&MenuItem7) { TakeBack(object); return; }
  427.   if (object == (APTR)&MenuItem8) { DoThinking(object); return; }
  428.   if (object == (APTR)&MenuItem1) { DoHint(object); return; }
  429.   if (object == (APTR)&MenuItem2) { DoTest(object); return; }
  430.   if (object == (APTR)&MenuItem3) { SetTime(object); return; }
  431. }
  432.  
  433. /* end of PowerWindows source generation */
  434.